const fs = require('fs')
const path = require('path')

function getFileByPath(fpath, sucCb, errCb){
    fs.readFile(fpath, 'utf-8', (err, dataStr) => {
        if (err) return errCb(err)
        sucCb(dataStr)
    })
}

getFileByPath(path.join(__dirname, './files/target.md'),function(data){
    console.log(data)
}, function(err){
    console.log('sorry about that:'+err.message)
})